package org.iabako.shared.querydefinition.columndefinition;

import org.iabako.client.tools.Messages;
import org.iabako.shared.querydefinition.dto.QueryResultValueType;

import java.io.Serializable;

/**
 * Created by jose on 12/02/15.
 */
public enum ClientConversationColumnEnum implements ColumnDefinition, Serializable {

    date("conversation.date", "result_table_conversation_date", "columnSplus inputcenter smalltable", null, QueryResultValueType.STRING),
    type("conversation.type", "result_table_conversation_type", "columnMminus", null, QueryResultValueType.STRING),
    interlocutor("conversation.interlocutor", "result_table_conversation_interlocutor", "columnMplus", null, QueryResultValueType.STRING),
    subject("conversation.subject", "result_table_conversation_subject", "columnMplus", null, QueryResultValueType.STRING),
    body("substring(conversation.body,1,200)", "result_table_conversation_body", "columnSminus", "commenticon", QueryResultValueType.STRING),
    status("conversation.status", null, null, null, null),
    automatic("conversation.automatic", null, null, null, null),

    //used in order by
    orderByStatusAndDate("conversation.status desc, conversation.date", null, null, null, null),

    //default filter
    client("conversation.client", null, null, null, null);

    private String hqlDefinition;
    private String labelKey;
    private String className;
    private String iconClassName;
    private QueryResultValueType queryResultValueType;


    ClientConversationColumnEnum(String hqlDefinition, String labelKey, String className, String iconClassName, QueryResultValueType queryResultValueType) {
        this.hqlDefinition = hqlDefinition;
        this.labelKey = labelKey;
        this.className = className;
        this.iconClassName = iconClassName;
        this.queryResultValueType = queryResultValueType;
    }

    public String getHqlDefinition() {
        return hqlDefinition;
    }

    public String getHqlJoin() {
        return null;
    }


    public String getLabel() {
        return Messages.getLabel(labelKey);
    }

    public String getLabelKey() {
        return labelKey;
    }

    public int getExcelColumnWidth() {
        return 0;
    }

    public boolean isOnlyInExcelExport() {
        return false;
    }

    public String getClassName() {
        return className;
    }

    public String getIconClassName() {
        return iconClassName;
    }

    public String getIconClassNameEmpty() {
        return null;
    }

    public String getTextEmpty() {
        return null;
    }

    public QueryResultValueType getQueryResultValueType() {
        return queryResultValueType;
    }
}
